package game.adm.entity;

import game.adm.dao.BonusDAO;
import game.adm.dao.dto.BonusDTO;
import game.adm.dao.factory.BonusFactory;
import game.adm.struts.form.BonusForm;

import java.util.List;

import projectx.core.base.ProjectXSystemException;
import projectx.core.base.ProjectXUserException;

public class BonusEntityManager {
	
	public static boolean isInitialized() throws ProjectXSystemException,ProjectXUserException{
		BonusFactory factory = BonusFactory.getFactory();
		BonusDAO dao = factory.getBonusDAO();
		return dao.isInitialized();
	}
	
	public static boolean initial(BonusForm bonusForm) throws ProjectXSystemException,ProjectXUserException{
		BonusFactory factory = BonusFactory.getFactory();
		BonusDAO dao = factory.getBonusDAO();
		return dao.initial(bonusForm);
	}
	
	public static boolean update(BonusForm bonusForm) throws ProjectXSystemException,
			ProjectXUserException {
		BonusFactory factory = BonusFactory.getFactory();
		BonusDAO dao = factory.getBonusDAO();
		return dao.update(bonusForm);
	}
	
	public static BonusDTO getBonusByID(String id) throws ProjectXSystemException,
			ProjectXUserException {
		BonusFactory factory = BonusFactory.getFactory();
		BonusDAO dao = factory.getBonusDAO();
		return dao.getBonusByID(id);
	}
	
	public static List<BonusDTO> listAdminBonus(BonusForm bonusForm) throws ProjectXSystemException,ProjectXUserException {
		BonusFactory factory = BonusFactory.getFactory();
		BonusDAO dao = factory.getBonusDAO();
		return dao.listAdminBonus(bonusForm);
	}
	
	public static List<BonusDTO> listUserBonus(BonusForm bonusForm) throws ProjectXSystemException,ProjectXUserException {
		BonusFactory factory = BonusFactory.getFactory();
		BonusDAO dao = factory.getBonusDAO();
		return dao.listUserBonus(bonusForm);
	}
}
